import axios from "./index"
import qs from 'qs'

// 催收记录
export const GetDoto = (current, pageSize) =>
  axios({
    url: "/collection/queryColl",
    method: "GET",
    params: {
      page:current,
      limit:pageSize
    },
  })

  // 即将到期
  export const GetDotofirst = (current, pageSize) =>
  axios({
    url: "/expiring/queryLoanZ",
    method: "GET",
    params: {
      page:current,
      limit:pageSize
    },
  })

  // 已逾期
  export const GetCollectionRecords = (current, pageSize) =>
      {
        current = Number(current)
        pageSize = Number(pageSize)
        return axios({
          url: "/overdue/queryOverdue",
          method: "GET",
          params: {
            page:current,
            limit:pageSize
          },
        })
      }

  // 到期提醒
  export const GetDueRemind = (id,plainOption) =>
{
    // id = Number(id)
    console.log(plainOption);
    return axios({
      url: "/expiring/updateExpiring",
      method: "POST",
      data:{
          loan_id:id,
          remind_way:plainOption
      },
    })
}

// 即将到期搜索
export const GetdotoSearch = (obj) =>
{
  // console.log(obj);
  obj.pageSizeNow = Number(obj.pageSizeNow)
  obj.pageSize = Number(obj.pageSize)
  return axios({
    url: "/expiring/queryLoanZList",
    method: "POST",
    data: {
      currentPage:obj.pageSizeNow,
      pageSize:obj.pageSize,
      data:{
        loan_id:obj.id,
        customer:{
          name:obj.name
        },
        contract:{
          con_no:obj.contract
        }
      }
    },
  })
}

// 逾期搜索
export const GetoverdueSearch = (obj) =>
{
  // console.log(obj);
  obj.pageSizeNow = String(obj.pageSizeNow)
  obj.pageSize = String(obj.pageSize)
  // console.log(id);
  return axios({
    url: "/overdue/searchOverdue",
    method: "POST",
    data: {
      currentPage:obj.pageSizeNow,
      pageSize:obj.pageSizeNow,
      data:{
        loan_id:obj.search1,
      }
    },
  })
}

// 催款记录搜索
export const CollectionSearch = (obj) =>{
  console.log(obj);
  return axios({
    url: "/collection/queryCollList",
    method: "POST",
    data:{
      currentPage:obj.pageSizeNow,
      pageSize:obj.pageSize,
      data:{
        id:obj.code
      }
    }
  })
}

// 贷款详情


// 贷款信息等


//逾期信息